package org.lagou.resultsethandler;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.ResultSetHandler;
import org.lagou.bean.GetResumeBean;
import org.lagou.bean.ResumeBean;


public class ResumeBeanResultsethandler implements ResultSetHandler<List<ResumeBean>>{

	@Override
	public List<ResumeBean> handle(ResultSet rs) throws SQLException {
		List<ResumeBean> list = new ArrayList<ResumeBean>();
		while (rs.next()) {
			ResumeBean info =new ResumeBean();
			info.setId(rs.getInt("id"));
			//info.setResumename(rs.getString("resumename"));
			info.setUserid(rs.getInt("userid"));
			//info.setName(rs.getString("name"));
			//info.setSex(rs.getString("sex"));
			//info.setEducation(rs.getString("education"));
			//info.setEdexperience(rs.getString("edexperience"));
			//info.setTel(rs.getString("tel"));
			//info.setEmail(rs.getString("email"));
			//info.setState(rs.getString("state"));
			//info.setImg(rs.getString("img"));
			info.setCity(rs.getString("city"));
			//info.setNature(rs.getString("nature"));
			//info.setRposition(rs.getString("rposition"));
			info.setSalary(rs.getString("salary"));
			//info.setOldcompany(rs.getString("oldcompany"));
			//info.setOldposition(rs.getString("oldposition"));
			//info.setSchool(rs.getString("school"));
			info.setDate(rs.getString("date"));
			 
			GetResumeBean ginfo=new GetResumeBean(rs.getInt("resumeid"),rs.getInt("state"), rs.getString("companyname"),rs.getString("positionname"), rs.getInt("userid"),rs.getString("date"));
			info.setGinfo(ginfo);
			
			list.add(info);
		}
		return list;
	}

}
